Component({
  properties: {
    label: {
      type: String,
      value: '任务状态'
    },
    statuses: {
      type: Array,
      value: [
        { id: 1, name: '待处理', class: 'pending' },
        { id: 2, name: '处理中', class: 'in-progress' },
        { id: 3, name: '待测试', class: 'testing' },
        { id: 4, name: '已完成', class: 'completed' }
      ]
    },
    selectedStatus: {
      type: Number,
      value: 1
    }
  },

  methods: {
    onSelectStatus(e) {
      const statusId = e.currentTarget.dataset.id
      this.setData({
        selectedStatus: statusId
      })
      
      // 触发自定义事件
      this.triggerEvent('statuschange', { statusId })
    }
  }
})